package com.music.service.impl;

import com.music.mapper.CopyrightMapper;
import com.music.pojo.Copyright;
import com.music.service.CopyrightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CopyrightServiceImpl implements CopyrightService {
    @Autowired(required = false)
    private CopyrightMapper copyrightMapper;
    @Override
    public List<Copyright> findAllCopyright() {
        return copyrightMapper.findAllCopyright();
    }

    @Override
    public List<Copyright> findInfoSongCopyright(int song_id) {
        return copyrightMapper.findInfoSongCopyright(song_id);
    }

    @Override
    public List<Copyright> findInfoSingerCopyright(int singer_id) {
        return copyrightMapper.findInfoSingerCopyright(singer_id);
    }

    @Override
    public boolean addCopyright(Copyright copyright) {
        return copyrightMapper.addCopyright(copyright)>0;
    }

    @Override
    public boolean deleteCopyright(int[] ids) {
        return copyrightMapper.deleteCopyright(ids)>0;
    }

    @Override
    public boolean updateCopyright(Copyright copyright) {
        return copyrightMapper.updateCopyright(copyright)>0;
    }
}
